package cn.schoolwow.workflow.module.definition.action.service;

import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.workflow.module.definition.action.flow.CheckDeployWorkArrayFlow;
import cn.schoolwow.workflow.module.definition.action.flow.CheckWorkFlowDeployRequestFlow;
import cn.schoolwow.workflow.module.definition.action.flow.InsertWorkFlowDefinitionFlow;

public class DeployWorkFlowServiceFlow implements BusinessFlow {
    @Override
    public void executeBusinessFlow(FlowContext flowContext) throws Exception {
        flowContext.startFlow(new CheckWorkFlowDeployRequestFlow())
                .next(new CheckDeployWorkArrayFlow())
                .next(new InsertWorkFlowDefinitionFlow())
                .execute();
    }

    @Override
    public String name() {
        return "部署工作流服务流程";
    }
}
